<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>登录页面 - Ch3nnn博客后台管理系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta content="Ch3nnn博客后台管理系统" name="keywords">
    <meta content="Ch3nnn博客后台管理系统是一个基于Bootstrap v3.3.7" name="description">
    <meta name="author" content="yinqi">
    <link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/MaterialDesign-Webfont/2.0.46/css/materialdesignicons.min.css"
          rel="stylesheet">
    <link href="https://dev-cdn.ch3nnn.cn/css/style.min.css" rel="stylesheet">

    <style>
        body {
            background-color: #fff;
        }

        .lyear-login-box {
            position: relative;
            overflow-x: hidden;
            width: 100%;
            height: 100%;
            -webkit-transition: 0.5s;
            -o-transition: 0.5s;
            transition: 0.5s;
        }

        .lyear-login-left {
            width: 50%;
            top: 0;
            left: 0;
            bottom: 0;
            position: fixed;
            height: 100%;
            z-index: 555;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
        }

        .lyear-overlay {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 10;
            background: rgba(0, 0, 0, 0.5);
        }

        .lyear-logo {
            margin-bottom: 50px;
        }

        .lyear-featured {
            z-index: 12;
            position: absolute;
            bottom: 0;
            padding: 30px;
            width: 100%;
        }

        .lyear-featured h4 {
            color: #fff;
            line-height: 32px;
        }

        .lyear-featured h4 small {
            color: #fff;
            display: block;
            text-align: right;
            margin-top: 15px;
        }

        .lyear-login-right {
            margin-left: 50%;
            position: relative;
            z-index: 999;
            padding: 100px;
            background-color: #fff;
        }

        @media screen and (max-width: 1024px) {
            .lyear-login-right {
                padding: 50px;
            }
        }

        @media screen and (max-width: 820px) {
            .lyear-login-left {
                width: 100%;
                position: relative;
                z-index: 999;
                height: 300px;
            }

            .lyear-login-right {
                margin-left: 0;
            }
        }

        @media screen and (max-width: 480px) {
            .lyear-login-right {
                padding: 50px;
            }
        }

        @media screen and (max-width: 320px) {
            .lyear-login-right {
                padding: 30px;
            }
        }
    </style>
</head>

<body>
<div class="lyear-login-box">
    <div class="lyear-login-left"
         style="background-image: url(https://pic2.zhimg.com/80/v2-373b94671e78fb0cac7b5e94f6aea9b5_1440w.jpg?source=1940ef5c)">
        <div class="lyear-overlay"></div>
        <div class="lyear-featured">
            <h4>愿你有好运气，如果没有，愿你在不幸中学会慈悲；愿你被很多人爱，如果没有，愿你在寂寞中学会宽容。<small> - 刘瑜《愿你慢慢长大》</small></h4>
        </div>
    </div>
    <div class="lyear-login-right">

        <div class="lyear-logo text-center">
            <h1>Ch3nnn博客管理登录</h1>
        </div>
        <div class="login-form">
            <div class="form-group">
                <label for="username">用户名</label>
                <input name="username" type="text" class="form-control" id="username" placeholder="请输入您的用户名">
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input name="password" type="password" class="form-control" id="password" placeholder="请输入您的密码">
            </div>

            <div class="form-group">
                <button class="btn btn-block btn-primary" onclick="clickLogin()" type="submit">立即登录</button>
            </div>
        </div>

    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/mouse0270-bootstrap-notify/3.1.3/bootstrap-notify.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-confirm/3.3.4/jquery-confirm.min.js"></script>
<script src="https://dev-cdn.ch3nnn.cn/js/lightyear.js"></script>

<!--消息通知-->
<script type="text/javascript">

    function clickLogin() {
        lightyear.loading('show');
        // 假设ajax提交操作
        $.ajax({
            type: "POST",
            url: "/admin/login2",
            contentType: "application/json",
            dataType: "json",
            timeout: 50000,
            data: JSON.stringify({"username": $('#username').val(), "password": $('#password').val()}),
            async: false,
            success: function (data) {
                lightyear.loading('show');
                // 假设ajax提交操作
                setTimeout(function () {
                    lightyear.loading('hide');
                    if (data.code === 1) {
                        // 跳转地址
                        window.location.href = window.location.protocol + '//' + window.location.host + data.data.url
                    } else {
                        lightyear.notify(data.msg, 'warning', 5000);
                    }
                }, 1e3)
            },
            error: function (err) {
                setTimeout(function () {
                    lightyear.loading('hide');
                    lightyear.notify('服务器错误，请稍后再试~', 'danger', 5000);
                }, 1e3)
            }
        });
    }
</script>


</body>
</html>